<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>add page</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<style type="text/css">
input[type='submit'],input[type='reset']{width: 45%;}
</style>
</head>
<body>
<%
String user=(String) session.getAttribute("user");
if(user==null){
	//out.print("你还没有登录！！！");
	//out.print("<a href='../login.jsp'>登录</a>");
	response.sendRedirect("error/needLogin.html");
}else{

%>
<form action="../addStudentServlet" method="post" class="form-horizontal col-md-12" role="form" style="margin-top: 20px;">

	<div class="form-group">
		<label class="col-sm-2 control-label">工号/学号:</label>
		<div class="col-sm-10">
			<input class="form-control" type="text" name="uid" id="uid" required="required"><span></span>
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label">用户名:</label>
		<div class="col-sm-10">
			<input class="form-control has-success" type="text" name="uname" id="uname" required="required"><span></span>
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label">密码:</label>
		<div class="col-sm-10">
			<input class="form-control" type="password" name="upass" id="upass" required="required"><span></span>
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label">确认密码:</label>
		<div class="col-sm-10">
			<input class="form-control" type="password" name="sureupass" id="sureupass" required="required"><span></span>
		</div>
	</div>

		<div class="form-group">
			<label class="col-sm-2 control-label">部门/院系:</label>
			<div class="col-sm-10">
				<select class="form-control" name="udepart" id="udepart">
						<option>信息工程学院</option>
						<option selected="selected">外国语学院</option>
						<option>艺术与传媒学院</option>
						<option>法学院</option>
						<option>管理学院</option>
						<option>会计学院</option>
						<option>金融与经济学院</option>
				</select><span></span>
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label">用户类型:</label>
			<div class="col-sm-10">
				<select class="form-control" name="utype" id="utype">
						<option>1</option>
						<option selected="selected">2</option>
				</select><span></span>
			</div>
		</div>

		<div class="form-group">
		<label class="col-sm-2"></label>
		<div class="col-sm-10">
			<input class="btn btn-success pull-left" type="submit" name="submit" id="submit" data-toggle="modal" data-target="#myModal" value="提交"></input>
			<input class="btn btn-waring pull-right" type="reset" name="reset" id="reset" value="重置">
		</div>
	</div>
</form>
<script type="text/javascript" src="js/formCheck.js"></script>
<script type="text/javascript">
	var sureupass=document.getElementById("sureupass");
	sureupass.onblur=function(){
		var regx=/^(?![A-Za-z]+$)(?![A-Z0-9]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![A-Z\W_!@#$%^&*`~()-+=+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{8,10}$/;
		var flag=regx.test(this.value);
		message(this,flag,'密码为10位以下包含数字、字母、特殊符号的混合');
		// a判断前后两次的密码是否一样
		if(flag){
			var theSame= upass.value==sureupass.value;
			message(this,theSame,"两次输入的密码不一致");
			if(!theSame){
				this.value="";
			}
		}
		return flag;
	}


</script>
<%} %>
</body>
</html>